-- 基础信息
local base_info = {
	group_id = 133314847
}

--================================================================
-- 
-- 配置
-- 
--================================================================

-- 怪物
monsters = {
	{ config_id = 847001, monster_id = 21020201, pos = { x = -431.724, y = 152.253, z = 4698.650 }, rot = { x = 0.000, y = 208.725, z = 0.000 }, level = 32, drop_tag = "丘丘暴徒", disableWander = true, pose_id = 401, area_id = 32 },
	{ config_id = 847004, monster_id = 21030401, pos = { x = -450.511, y = 149.400, z = 4687.598 }, rot = { x = 0.000, y = 118.016, z = 0.000 }, level = 32, drop_tag = "丘丘萨满", pose_id = 9012, area_id = 32 },
	{ config_id = 847005, monster_id = 21010301, pos = { x = -438.930, y = 145.694, z = 4686.955 }, rot = { x = 0.000, y = 33.284, z = 0.000 }, level = 32, drop_tag = "丘丘人", pose_id = 9012, area_id = 32 },
	{ config_id = 847006, monster_id = 21010301, pos = { x = -431.894, y = 145.404, z = 4684.234 }, rot = { x = 0.000, y = 320.134, z = 0.000 }, level = 32, drop_tag = "丘丘人", pose_id = 9012, area_id = 32 },
	{ config_id = 847007, monster_id = 21010501, pos = { x = -436.376, y = 144.621, z = 4684.431 }, rot = { x = 0.000, y = 23.308, z = 0.000 }, level = 32, drop_tag = "远程丘丘人", pose_id = 9012, area_id = 32 }
}

-- NPC
npcs = {
}

-- 装置
gadgets = {
	{ config_id = 847002, gadget_id = 70211012, pos = { x = -434.634, y = 146.226, z = 4686.851 }, rot = { x = 346.151, y = 26.858, z = 359.916 }, level = 26, drop_tag = "战斗中级须弥", state = GadgetState.ChestLocked, isOneoff = true, persistent = true, explore = { name = "chest", exp = 10 }, area_id = 32 },
	{ config_id = 847008, gadget_id = 71700105, pos = { x = -435.811, y = 146.253, z = 4687.289 }, rot = { x = 0.405, y = 114.317, z = 356.734 }, level = 32, area_id = 32 },
	{ config_id = 847009, gadget_id = 71700105, pos = { x = -433.382, y = 146.119, z = 4686.240 }, rot = { x = 1.689, y = 119.729, z = 354.659 }, level = 32, area_id = 32 },
	{ config_id = 847010, gadget_id = 70310006, pos = { x = -429.300, y = 152.239, z = 4697.098 }, rot = { x = 0.000, y = 0.000, z = 0.000 }, level = 32, area_id = 32 },
	{ config_id = 847011, gadget_id = 70210101, pos = { x = -427.074, y = 145.994, z = 4683.097 }, rot = { x = 0.000, y = 0.000, z = 0.000 }, level = 26, drop_tag = "搜刮点解谜破损须弥", persistent = true, area_id = 32 },
	{ config_id = 847012, gadget_id = 70210101, pos = { x = -425.363, y = 146.666, z = 4683.514 }, rot = { x = 0.000, y = 0.000, z = 0.000 }, level = 26, drop_tag = "搜刮点解谜武器须弥", persistent = true, area_id = 32 }
}

-- 区域
regions = {
}

-- 触发器
triggers = {
	{ config_id = 1847003, name = "ANY_MONSTER_DIE_847003", event = EventType.EVENT_ANY_MONSTER_DIE, source = "", condition = "condition_EVENT_ANY_MONSTER_DIE_847003", action = "action_EVENT_ANY_MONSTER_DIE_847003" }
}

-- 变量
variables = {
}

--================================================================
-- 
-- 初始化配置
-- 
--================================================================

-- 初始化时创建
init_config = {
	suite = 1,
	end_suite = 0,
	rand_suite = false
}

--================================================================
-- 
-- 小组配置
-- 
--================================================================

suites = {
	{
		-- suite_id = 1,
		-- description = ,
		monsters = { 847001, 847004, 847005, 847006, 847007 },
		gadgets = { 847002, 847008, 847009, 847010, 847011, 847012 },
		regions = { },
		triggers = { "ANY_MONSTER_DIE_847003" },
		rand_weight = 100
	}
}

--================================================================
-- 
-- 触发器
-- 
--================================================================

-- 触发条件
function condition_EVENT_ANY_MONSTER_DIE_847003(context, evt)
	-- 判断剩余怪物数量是否是0
	if ScriptLib.GetGroupMonsterCount(context) ~= 0 then
		return false
	end
	
	return true
end

-- 触发操作
function action_EVENT_ANY_MONSTER_DIE_847003(context, evt)
	-- 将configid为 847002 的物件更改为状态 GadgetState.Default
	if 0 ~= ScriptLib.SetGadgetStateByConfigId(context, 847002, GadgetState.Default) then
	  ScriptLib.PrintContextLog(context, "@@ LUA_WARNING : set_gadget_state_by_configId")
			return -1
		end 
	
	-- 运营数据埋点，匹配LD定义的规则使用
	    if 0 ~= ScriptLib.MarkPlayerAction(context, 4000, 3, 1) then
	      ScriptLib.PrintContextLog(context, "@@ LUA_WARNING : mark_playerAction")
	      return -1
	    end
	
	return 0
end